package com.web709.dto;

import com.web709.entity.Demand;
import lombok.Data;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

@Data
public class DemandDto extends Demand {
    private List<String> imgList = new ArrayList<>();

    public void setImgPaths(String escapedImgPaths) {
        if (escapedImgPaths != null && !escapedImgPaths.isEmpty()) {
            // 假设图片路径之间用逗号分隔
            this.imgList = new ArrayList<>(Arrays.asList(escapedImgPaths.split(",")));
        } else {
            this.imgList.clear();
        }
    }
}